<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="title">经费预算表</c:set>
<c:if test="${not empty param.title }"><c:set var="title">${param.title }</c:set></c:if>

<div class="t_bar2">
	大型设备购置申请表
</div>
<table  id="tblExecuteProducts" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0">
		<thead>
		<tr>
			<th class="TblHead" align="center" width="4%"  >选择</th>
			<th class="TblHead" align="center" width="5%"  >序号</th>
			<th class="TblHead" align="center" width="20%">设备名称</th>
			<th class="TblHead" align="center" width="15%">设备型号</th>
			<th class="TblHead" align="center" width="16%">生产国别</th>
			<th class="TblHead" align="center" width="10%">生产厂家</th>
			<th class="TblHead" align="center" width="10%">设备数量</th>
			<th class="TblHead" align="center" width="10%">设备总价</th>
			<th class="TblHead" align="center" width="10%">申请财政资金</th>
			<!-- <th class="TblHead" align="center" width="6%">申请贴息年度</th>
			<th class="TblHead" align="center" width="10%">首笔付息日期</th> -->
			</tr>
		</thead>
	<tbody>
	<tr style="display: none">
 		<td align="center" >
 			<input type="radio" class="radiobutton" name="selExecuteProducts" onclick=""/>
 			<input type="hidden" name="loans|loan[0]|xmldata"/>
 		</td>
 		<td align="center" >
 			<span name="loans|loan[0]@seq_no" >[index]</span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|fac_name" ></span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|fac_model" ></span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|country" ></span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|factory" ></span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|fac_num" ></span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|fac_total" ></span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|app_fund" ></span>
 		</td>
 		<!-- <td align="center">
 			<span name="loans|loan[0]|basicinfo|apply_year" ></span>
 		</td>
 		<td align="center">
 			<span name="loans|loan[0]|basicinfo|first_date" ></span>
 		</td> -->
 		 
 	</tr>

		<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/loans/loan" var="loan">
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr align="center">
					<td  >
			 			<input type="radio" class="radiobutton" name="selExecuteProducts" onclick=""/>
			 			<input type="hidden" name="loans/loan[${flag}${index}]/xmldata" value="<x:out select="$loan/xmldata"/>"/>
			 		</td>
			 		<td  >
			 			<span name="loans/loan[${flag}${index}]@seq_no" ><x:out select="$loan/@seq_no"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_name" ><x:out select="$loan/basicinfo/fac_name"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_model" ><x:out select="$loan/basicinfo/fac_model"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/country" ><x:out select="$loan/basicinfo/country"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/factory" ><x:out select="$loan/basicinfo/factory"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_num" ><x:out select="$loan/basicinfo/fac_num"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/fac_total" ><x:out select="$loan/basicinfo/fac_total"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/app_fund" ><x:out select="$loan/basicinfo/app_fund"/></span>
			 		</td>
			 	<%-- 	<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/apply_year" ><x:out select="$loan/basicinfo/apply_year"/></span>
			 		</td>
			 		<td >
			 			<span name="loans/loan[${flag}${index}]/basicinfo/first_date" ><x:out select="$loan/basicinfo/first_date"/></span>
			 		</td> --%>
				</tr>
				<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
		</tbody>
					</table>
				

	<table width="100%" align="center"  >
	<tr><td>
		<input class="button" name="cmdAddbefore" id="cmdAddbeforeProduct" type="button" value="添加" onclick="if(checkTabLimit('tblExecuteProducts',3,'${title }最多只能填写3条')){addRow();}try{top.resizeFrame();}catch(e){};"/>
		<input class="button" name="cmdMovePrev" id="cmdMovePrevProduct" type="button" value="上移" onclick="movePrev('tblExecuteProducts','selExecuteProducts');"/>
		<input class="button" name="cmdMoveNext" id="cmdMoveNextProduct" type="button" value="下移" onclick="moveNext('tblExecuteProducts','selExecuteProducts');"/>
		<input class="button" name="cmdEdit" id="cmdEditProduct" type="button" value="编辑" onclick="update();"/>
		<input class="button" name="cmddel" id="cmddelProduct" type="button" value="删除" onclick="deleteSelectedRow('tblExecuteProducts','${title }')"/>
	</td></tr>
</table>
<div class="t_bar2">
	试制设备费预算明细表
</div>

<table  id="heisi_wangkun" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
			<col width="5%" />
			<col width="5%" />
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center" >选择</th>
						<th class="TblHead" align="center" >序号</th>
						<th class="TblHead" align="center" >试制设备工作内容</th> 
						<th class="TblHead" align="center" >经费预算</th> 
				     	<th class="TblHead" align="center" >申请财政资助</th> 
						<th class="TblHead" align="center" >与项目实施关系</th> 
						
					</tr>
			
			</thead>
			<tbody id="tab">
					<tr style="display:none" align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="heisi_wangkun" >
						</td>
						<td align="center">
							<span name="heisi_wangkun|list[0]@seq_no" >[index]</span> 
						</td>
						<td>
							<input type="text" name="heisi_wangkun|list[0]|content" label="试制设备工作内容" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
				
						<td align="center">
							<input type="text" name="heisi_wangkun|list[0]|budget"  onchange="qiuhe1('heisi_wangkun');"
								label="经费预算" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td align="center">
							<input type="text" name="heisi_wangkun|list[0]|application"  onchange="qiuhe2('heisi_wangkun');" 
							label="申请财政资助" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						
						<td>
							<input type="text" name="heisi_wangkun|list[0]|remark"   label="与项目实施关系"  style="text-align:right;width:80%" class=" input_text required" />
						</td>
						
						
					</tr>
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/heisi_wangkun/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="heisi_wangkun" >
						</td>
						<td align="center">
							<span name="heisi_wangkun/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<input type="text" name="heisi_wangkun/list[${flag}${index}]/content"  value="<x:out select="$list/content"/>"   label="试制设备工作内容" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						
						<td align="center">
							<input type="text" name="heisi_wangkun/list[${flag}${index}]/budget"  value="<x:out select="$list/budget"/>"   onchange="qiuhe1('heisi_wangkun');"
								label="经费预算" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td align="center">
							<input type="text" name="heisi_wangkun/list[${flag}${index}]/application" value="<x:out select="$list/application"/>"   onchange="qiuhe2('heisi_wangkun');"
							label="申请财政资助" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						<td>
							<input type="text" name="heisi_wangkun/list[${flag}${index}]/remark" value="<x:out select="$list/remark"/>"   label="与项目实施关系"  style="text-align:right;width:80%" class=" input_text required" />
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("heisi_wangkun");
					</script>
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
			<col width="5%" />
			<col width="5%" />
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<tr align="center">
				<td colspan="3">合     计</td>
				<td><input name="heisi_wangkun_list/budget_total" id="budget_total" value="<x:out select="$xmlData/data/heisi_wangkun_list/budget_total" />" label="计划新增设备清单明细表数量合计" class="gray input_text"  disabled style="text-align:right;width:80%" onfocus="InitInput.setNumber(this,7,0,0)" /></td>
				<td><input name="heisi_wangkun_list/application_total" id="application_total" value="<x:out select="$xmlData/data/heisi_wangkun_list/application_total" />" label="计划新增设备清单明细表数量合计" class="gray input_text"  disabled style="text-align:right;width:80%" onfocus="InitInput.setNumber(this,7,0,0)" /></td>
				<td align="center">/</td>
				
			</tr>
	</table>	
			
		<table width="98%" align="center" border="0">
					<tr style="border: 0"><td style="border: 0">
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('heisi_wangkun',99,'试制设备费预算明细表最多只能添加99条')){addNewRow('heisi_wangkun');showDateTag('heisi_wangkun');try{top.resizeFrame();}catch(e){};}">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('heisi_wangkun','heisi_wangkun')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('heisi_wangkun','heisi_wangkun')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('heisi_wangkun','试制设备费预算明细表');qiuhe1('heisi_wangkun');qiuhe2('heisi_wangkun');">
					</td></tr>
	</table>	

	
<div class="t_bar2">
	设备改造与租赁费明细表
</div>

<table  id="transformation_lease" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
			<col width="5%" />
			<col width="5%" />
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center" >选择</th>
						<th class="TblHead" align="center" >序号</th>
						<th class="TblHead" align="center" >设备改造与租赁工作内容</th> 
						<th class="TblHead" align="center" >经费预算</th> 
				     	<th class="TblHead" align="center" >申请财政资助</th> 
						<th class="TblHead" align="center" >与项目实施关系</th> 
						
					</tr>
			
			</thead>
			<tbody id="tab">
					<tr style="display:none" align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="transformation_lease" >
						</td>
						<td align="center">
							<span name="transformation_lease|list[0]@seq_no" >[index]</span> 
						</td>
						<td>
							<input type="text" name="transformation_lease|list[0]|content" label="设备改造与租赁工作内容" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
				
						<td align="center">
							<input type="text" name="transformation_lease|list[0]|budget"  onchange="qiuhe3('transformation_lease');"
								label="经费预算" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td align="center">
							<input type="text" name="transformation_lease|list[0]|application"  onchange="qiuhe4('transformation_lease');" 
							label="申请财政资助" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						
						<td>
							<input type="text" name="transformation_lease|list[0]|remark"   label="与项目实施关系"  style="text-align:right;width:80%" class=" input_text required" />
						</td>
						
						
					</tr>
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/transformation_lease/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="transformation_lease" >
						</td>
						<td align="center">
							<span name="transformation_lease/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<input type="text" name="transformation_lease/list[${flag}${index}]/content"  value="<x:out select="$list/content"/>"   label="设备改造与租赁工作内容" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						
						<td align="center">
							<input type="text" name="transformation_lease/list[${flag}${index}]/budget"  value="<x:out select="$list/budget"/>"   onchange="qiuhe3('transformation_lease');"
								label="经费预算" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td align="center">
							<input type="text" name="transformation_lease/list[${flag}${index}]/application" value="<x:out select="$list/application"/>"   onchange="qiuhe4('transformation_lease');"
							label="申请财政资助" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						<td>
							<input type="text" name="transformation_lease/list[${flag}${index}]/remark" value="<x:out select="$list/remark"/>"   label="与项目实施关系"  style="text-align:right;width:80%" class=" input_text required" />
						</td>
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("transformation_lease");
					</script>
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
			<col width="5%" />
			<col width="5%" />
			<col width="25%" />
			<col width="20%" />
			<col width="20%" />
			<col width="25%" />
			<tr align="center">
				<td colspan="3">合     计</td>
				<td><input name="transformation_lease/budget_total" id="transformation_lease_budget" value="<x:out select="$xmlData/data/transformation_lease/budget_total" />" label="计划新增设备清单明细表数量合计" class="gray input_text"  disabled style="text-align:right;width:80%" onfocus="InitInput.setNumber(this,7,0,0)" /></td>
				<td><input name="transformation_lease/application_total" id="transformation_lease_application" value="<x:out select="$xmlData/data/transformation_lease/application_total" />" label="计划新增设备清单明细表数量合计" class="gray input_text"  disabled style="text-align:right;width:80%" onfocus="InitInput.setNumber(this,7,0,0)" /></td>
				<td align="center">/</td>
				
			</tr>
		
	</table>		
		<table width="98%" align="center" border="0">
					<tr style="border: 0"><td style="border: 0">
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('transformation_lease',99,'设备改造与租赁费明细表最多只能添加99条')){addNewRow('transformation_lease');showDateTag('transformation_lease');try{top.resizeFrame();}catch(e){};}">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('transformation_lease','transformation_lease')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('transformation_lease','transformation_lease')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('transformation_lease','设备改造与租赁费明细表');qiuhe3('transformation_lease');qiuhe4('transformation_lease');">
					</td></tr>
	</table>	

	

<div class="t_bar2">
	化验加工费预算明细表
</div>

<table  id="assay" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
			<col width="5%" />
			<col width="5%" />
			<col width="25%" />
			<col width="25%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center" >选择</th>
						<th class="TblHead" align="center" >序号</th>
						<th class="TblHead" align="center" >测试化验加工的内容</th> 
						<th class="TblHead" align="center" >测试化验加工单位</th> 
				     	<th class="TblHead" align="center" >计量单位</th> 
						<th class="TblHead" align="center" >单价<br/>（元/单位数量）</th> 
						<th class="TblHead" align="center" >数量</th> 
						<th class="TblHead" align="center" >金额</th> 
						
					</tr>
			
			</thead>
			<tbody id="tab">
					<tr style="display:none" align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="assay" >
						</td>
						<td align="center">
							<span name="assay|list[0]@seq_no" >[index]</span> 
						</td>
						<td>
							<input type="text" name="assay|list[0]|content" label="测试化验加工的内容" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td>
							<input type="text" name="assay|list[0]|org" label="测试化验加工单位" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td>
							<input type="text" name="assay|list[0]|measure" label="计量单位" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td align="center">
							<input type="text" name="assay|list[0]|price"  onchange="countjsTotal(this);qiuhe5('assay');"
								label="单价" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td align="center">
							<input type="text" name="assay|list[0]|amount"  onchange="countjsTotal(this);qiuhe5('assay');"
								label="数量" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td>
						
						
				
						<td align="center">
							<input type="text" name="assay|list[0]|money"   disabled
								label="金额" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text gray" />
						</td> 
					
						
						
					</tr>
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/assay/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="assay" >
						</td>
						<td align="center">
							<span name="assay/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<input type="text" name="assay/list[${flag}${index}]/content"  value="<x:out select="$list/content"/>"   label="测试化验加工的内容" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td>
							<input type="text" name="assay/list[${flag}${index}]/org"  value="<x:out select="$list/org"/>"   label="测试化验加工单位" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td>
							<input type="text" name="assay/list[${flag}${index}]/measure"  value="<x:out select="$list/measure"/>"   label="计量单位" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td align="center">
							<input type="text" name="assay/list[${flag}${index}]/price" value="<x:out select="$list/price"/>"   onchange="countjsTotal(this);qiuhe5('assay');"
							label="单价" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						<td align="center">
							<input type="text" name="assay/list[${flag}${index}]/amount" value="<x:out select="$list/amount"/>"   onchange="countjsTotal(this);qiuhe5('assay');"
							label="数量" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						
						
						
						<td align="center">
							<input type="text" name="assay/list[${flag}${index}]/money" value="<x:out select="$list/money"/>"  
							label="total" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text gray" disabled/>
						</td>
						
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("transformation_lease");
					</script>
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
			<col width="5%" />
			<col width="5%" />
			<col width="25%" />
			<col width="25%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<tr align="center">
				<td colspan="3">量大及价高测试化验费合计</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">
					<input type="text" name="proposal/expensive" id="expensive" value="<x:out select="$xmlData/data/proposal/expensive"/>"   onchange="countFundAuto('','assay_list_total,other_assay,expensive','assay_total');"
						label="量大及价高测试化验费合计" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
				</td>
				
			</tr>
				<tr align="center">
				<td colspan="3">其他测试化验费</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td>
				<input type="text" name="proposal/other_assay" id="other_assay" value="<x:out select="$xmlData/data/proposal/other_assay"/>"   onchange="countFundAuto('','assay_list_total,other_assay,expensive','assay_total');"
						label="其他测试化验费" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
				</td>
			</tr>
			<tr align="center">
				<td colspan="3">合     计</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">/</td>
				<td align="center">
					<input type="hidden" name="proposal/assay_list_total" id="assay_list_total" value="<x:out select="$xmlData/data/proposal/assay_list_total"/>" 
						label="合     计" onfocus="InitInput.setNumber(this,7,2,2)" />
					<input type="text" name="proposal/assay_total" id="assay_total" value="<x:out select="$xmlData/data/proposal/assay_total"/>"   onchange=""
						label="合     计" onfocus="InitInput.setNumber(this,7,2,2)" disabled style="text-align:right;width:80%" class=" input_text gray" />
				</td>
				
			</tr>
		
		</table>	
		<table width="98%" align="center" border="0">
					<tr style="border: 0"><td style="border: 0">
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimit('assay',99,'设备改造与租赁费明细表最多只能添加99条')){addNewRow('assay');showDateTag('assay');try{top.resizeFrame();}catch(e){};}">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('assay','assay')">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('assay','assay')">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('assay','设备改造与租赁费明细表');qiuhe5('assay');">
					</td></tr>
	</table>	

<div class="t_bar2">
	承担单位研究经费支出预算明细表
</div>

<table  id="undertaker" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;table-layout: fixed;" >
			<col width="5%" />
			<col width="5%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			
			<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center"  rowspan="2">选择</th>
						<th class="TblHead" align="center"  rowspan="2">序号</th>
						<th class="TblHead" align="center"  rowspan="2">单位名称</th> 
						<th class="TblHead" align="center"  rowspan="2">组织机构代码</th> 
				
						<th class="TblHead" align="center"  rowspan="2">承担单位类型</th>
						<th class="TblHead" align="center"  rowspan="2">任务分工</th>
						<th class="TblHead" align="center"  rowspan="2">研究任务负责人</th>  
						<th class="TblHead" align="center"  rowspan="2">合计</th>
						<th class="TblHead" align="center"  colspan="2">专项经费</th>  
						<th class="TblHead" align="center"  rowspan="2">自筹经费</th>             
					</tr>
					<tr style="border:1px solid #B7D1E6"> 
				      <th class="TblHead" align="center">小计</th>  
						<th class="TblHead" align="center">其中：间接费用</th>      
					</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none" align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="undertaker" >
						</td>
						<td align="center">
							<span name="undertaker|list[0]@seq_no" >[index]</span> 
						</td>
						<td>
							<input type="text" name="undertaker|list[0]|name" label="单位名称" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td style="text-align: center;">
				        	<input type="text" name="undertaker|list[0]|org_code" label="组织机构代码" class=" required input_text " maxlength="50" style="width:80%"/>
			         </td>
						<td>
							 <cpt:select id="org_type[index]" key="org_type1"  name="org_type" onChange="initControlValue(this.id);" style="width:80%"></cpt:select>
		                <input type="hidden" name="undertaker|list[0]|org_type_value" class="required" label="承担单位类型" />
		                <input type="hidden" name="undertaker|list[0]|org_type_name" value=""/>  
						</td>
						<td style="text-align: center;">
				        	<input type="text" name="undertaker|list[0]|division" label="任务分工" class=" required input_text " maxlength="50" style="width:80%"/>
			         </td>
			         <td style="text-align: center;">
				        	<input type="text" name="undertaker|list[0]|division_psn" label="研究任务负责人" class=" required input_text " maxlength="50" style="width:80%"/>
			         </td>
						<td>
							<input type="text" name="undertaker|list[0]|total"  onchange="countjsTable9('undertaker');" 
							label="合计" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						<td>
							<input type="text" name="undertaker|list[0]|special_fund"  onchange="countjsTable9('undertaker');" 
							label="专项经费-->小计" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						<td>
							<input type="text" name="undertaker|list[0]|special_indirect"  onchange="countjsTable9('undertaker');" 
							label="专项经费-->其中：间接费用" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						<td>
							<input type="text" name="undertaker|list[0]|self_fund"  onchange="countjsTable9('undertaker');" 
							label="自筹经费" onfocus="InitInput.setNumber(this,7,2,2)" style="text-align:right;width:80%" class=" input_text required" />
						</td>
						
						
						
					</tr>
					
					<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/undertaker/list" var="list">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr align="center">
						<td align="center">
							<input type="radio" class="radiobutton" name="undertaker" >
						</td>
						<td align="center">
							<span name="undertaker/list[${flag}${index}]@seq_no" ><x:out select="$list/@seq_no"/></span> 
						</td>
						<td>
							<input type="text" name="undertaker/list[${flag}${index}]/name"  value="<x:out select="$list/name"/>"   label="单位名称" class=" required input_text " maxlength="50" style="width:80%"/>
						</td>
						<td style="text-align: center;">
				        	<input type="text" name="undertaker/list[${flag}${index}]/org_code" value="<x:out select="$list/org_code"/>" label="组织机构代码" class=" required input_text " maxlength="50" style="width:80%"/>
			         </td>
			         <td>
			         	<c:set var="org_type_value"><x:out select="$list/org_type_value" /></c:set>
							<cpt:select id="org_type${index}" key="org_type1" name="org_type"  value="${org_type_value }" onChange="initControlValue(this.id);" style="width:80%"></cpt:select>
			            <input type="hidden" name="undertaker/list[${flag}${index}]/org_type_value" class="required" label="承担单位类型" value="<x:out select="$list/org_type_value" />"/>
			            <input type="hidden" name="undertaker/list[${flag}${index}]/org_type_name" value="<x:out select="$list/org_type_name" />"/>
			         </td>
			         <td style="text-align: center;">
				        	<input type="text" name="undertaker/list[${flag}${index}]/division" value="<x:out select="$list/division"/>" label="任务分工" class=" required input_text " maxlength="50" style="width:80%"/>
			         </td>
			          <td style="text-align: center;">
				        	<input type="text" name="undertaker/list[${flag}${index}]/division_psn" value="<x:out select="$list/division_psn"/>" label="研究任务负责人" class=" required input_text " maxlength="50" style="width:80%"/>
			         </td>
			         
						<td>
							<input type="text" name="undertaker/list[${flag}${index}]/total"  value="<x:out select="$list/total"/>"   onchange="countjsTable9('undertaker');"
								label="合计" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td>
							<input type="text" name="undertaker/list[${flag}${index}]/special_fund"  value="<x:out select="$list/special_fund"/>"   onchange="countjsTable9('undertaker');"
								label="专项经费-->小计" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td>
							<input type="text" name="undertaker/list[${flag}${index}]/special_indirect"  value="<x:out select="$list/special_indirect"/>"   onchange="countjsTable9('undertaker');"
								label="专项经费-->其中：间接费用" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						<td>
							<input type="text" name="undertaker/list[${flag}${index}]/self_fund"  value="<x:out select="$list/self_fund"/>"   onchange="countjsTable9('undertaker');"
								label="自筹经费" onfocus="InitInput.setNumber(this,7,2,2)"   style="text-align:right;width:80%" class=" input_text required" />
						</td> 
						
						
						
					</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
					<script type="text/javascript">
						showAllDateTag("undertaker");
					</script>
				</tbody>
				</table>
		<table   cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;" id="budgetsMsg4">
			<col width="5%" />
			<col width="5%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<col width="10%" />
			<tr align="center">
				<td colspan="7">合     计</td>
				<td>
					<input type="text" name="proposal/undertaker_total" id="undertaker_total" value="<x:out select="$xmlData/data/proposal/undertaker_total"/>"   onchange=""
						label="合     计" onfocus="InitInput.setNumber(this,7,2,2)" disabled style="text-align:right;width:80%" class=" input_text gray" />
				</td>
				<td>
					<input type="text" name="proposal/special_fund_total" id="special_fund_total" value="<x:out select="$xmlData/data/proposal/special_fund_total"/>"   onchange=""
						label="合     计" onfocus="InitInput.setNumber(this,7,2,2)" disabled style="text-align:right;width:80%" class=" input_text gray" />
				</td>
				<td>
					<input type="text" name="proposal/special_indirect" id="special_indirect" value="<x:out select="$xmlData/data/proposal/special_indirect"/>"   onchange=""
						label="合     计" onfocus="InitInput.setNumber(this,7,2,2)" disabled style="text-align:right;width:80%" class=" input_text gray" />
				</td>
				<td>
					<input type="text" name="proposal/self_fund" id="self_fund" value="<x:out select="$xmlData/data/proposal/self_fund"/>"   onchange=""
						label="合     计" onfocus="InitInput.setNumber(this,7,2,2)" disabled style="text-align:right;width:80%" class=" input_text gray" />
				</td>
				
			</tr>
		
			
		</table> 
					<table width="98%" align="center" border="0">
					<tr style="border: 0"><td style="border: 0">
					<input class="button" name="cmdAddbefore" type=button value="添加" onclick="if(checkTabLimitRewrite_5('undertaker',11,'最多只能添加10条承担单位研究经费支出预算明细表')){addNewRow2('undertaker');showDateTag('undertaker');refreshRowINdex2('undertaker');try{top.resizeFrame();}catch(e){};}">
					<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('undertaker','undertaker');refreshRowINdex2('undertaker');">
					<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('undertaker','undertaker');refreshRowINdex2('undertaker');">
					<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('undertaker','承担单位研究经费支出预算明细表');countjsTable3('undertaker');refreshRowINdex2('undertaker');">
					</td></tr>
	</table>	
		
<script type="text/javascript">
function countjsTable9(tblId){
 	var count1=0;
	var count2=0;
   var count3=0;
   var count4=0;
   $("#"+tblId+" tr:gt(2)").each(function() {  
	   var fund1 = $(this).children().eq("7").children().val();   //注册资本
	   var fund2 = $(this).children().eq("8").children().val();   //实收资本
	   var fund3 = $(this).children().eq("9").children().val();   //单位人数
	   var fund4 = $(this).children().eq("10").children().val();   //高管人数
	   if (!$.isNumeric(fund1)) fund1 = "0.00";
	   if (!$.isNumeric(fund2)) fund2 = "0.00";
	   if (!$.isNumeric(fund3)) fund3 = "0.00";
	   if (!$.isNumeric(fund4)) fund4 = "0.00";

	   count1=accAdd(parseFloat(fund1),parseFloat(count1));   //合计相加
		count2=accAdd(parseFloat(fund2),parseFloat(count2));   //合计相加
		count3=accAdd(parseFloat(fund3),parseFloat(count3));   //合计相加
		count4=accAdd(parseFloat(fund4),parseFloat(count4));   //合计相加

});
   
  
   count1 = formatNumberAutoOther(count1.toString(), 9, 2, 2);// 格式化金额
  	count2 = formatNumberAutoOther(count2.toString(), 9, 2, 2);// 格式化金额
   count3 = formatNumberAutoOther(count3.toString(), 9, 2, 2);// 格式化金额
   count4 = formatNumberAutoOther(count4.toString(), 9, 2, 2);// 格式化金额
   

	 
	  $("#undertaker_total").val(count1);
	  $("#special_fund_total").val(count2);
	  $("#special_indirect").val(count3);
	  $("#self_fund").val(count4);
	  

  
}






</script>	
	
	
	




<script type="text/javascript">
	//添加
	function addRow() {
		sourceXML = "<data></data>";
		xmlEncrypt(sourceXML);
		addNewRow(
				'tblExecuteProducts',
				"${ctx}/proposal/edit/equipment/"+'loansInfo'+"?flag=add"+"&TB_iframe=true&width=900", '增加大型设备购置申请表');
		try {
			top.resizeFrame();
		} catch (e) {
		}
		;
	}

	//更新
	function update() {
		var selectedRow = getSelectedRow("selExecuteProducts");
		var xmldata = $(selectedRow).find("input[name$='xmldata']").val();
		if (xmldata == "") {
			xmldata = "<data></data>";
		}
		xmlEncrypt(xmldata);
		editRow('tblExecuteProducts', "${ctx}/proposal/edit/equipment/"
				+ 'loansInfo' + "?flag=edit"
				+ "&TB_iframe=true&width=900", '编辑大型设备购置申请表');
	}

	
	//查看
/* 	function ViewMemberDetail(obj) {
		var radioname = "selExecuteProducts";
		var tr = obj.parentElement.parentElement;
		var selectedRow = tr;
		var xmldata = $(selectedRow).find("input[name$='xmldata']").val();
		$(selectedRow).find(":radio").attr("checked","checked");
		if (xmldata == "")
			xmldata = "<data></data>";
		xmlEncrypt(xmldata);
		editRow2('tblExecuteProducts', "${ctx}/proposal/edit/2014/groupMember/"
				+ 'addMember' + "?flag=view"
				+ "&TB_iframe=true&width=900", '查看');
	} */

	
	//重写 查看时不必检查 是否选择
	function editRow2(tableId,url,title)
		{
		if(url!=null&&url!=""){
			showThickBox(url,title);
		}
		} 
	
	function getSelectedRow(radioname) {
		var selectedRadio = $("input[name=" + radioname + "]:checked").get(0);
		// public.js 已做此检查
		/* if (selectedRadio == null) {
			alert("请先选择一条记录！");
			return null;
		} */
		var tr = $(selectedRadio).parents("tr").get(0);
		return tr;

	}

	/**
	 * 打开页面查看内容
	 * @param tableId 表格id
	 * @param startRowIndex 起始行
	 * @param url 跳转url
	 * @param selObj 没有选中行,就指当前对象所在行
	 */
	function viewRow(tableId, url, title, selObj) {
		if (selObj) {

		}
		if (url != null && url != "") {
			showThickBox(url, title);
		}
	}

	function xmlEncrypt(strXmlData) {

		var xmlHttpRequest;
		if (window.ActiveXObject) //IE和其他的浏览器实现XMLHttpRequest的方式不同

		{
			xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
		} else {
			xmlHttpRequest = new XMLHttpRequest();
		}

		var url = ctx + '/ajax/ajaxEncrypt';
		xmlHttpRequest.open('POST', url, false);
		xmlHttpRequest.setRequestHeader("Content-Type",
				"application/x-www-form-urlencoded");
		xmlHttpRequest.send("&xmldata=" + encodeURIComponent(strXmlData));
		return xmlHttpRequest.responseText;

	}
	function qiuhe1(tblId,flag_required){
		  
		   var count5=0;
		   $("#"+tblId+" tr:gt(1)").each(function() {
			   var fund2 = $(this).children().eq("3").find("input").val();   //总价
			   if (!$.isNumeric(fund2)) fund2 = "0.00";
				count5 = accAdd(parseFloat(fund2),parseFloat(count5));  //总价		
	   		 });
	      count5 = formatNumberAutoOther(count5.toString(), 9, 2, 2);// 格式化金额
	     
	     	$("#budget_total").val(count5);  
	     	
	}
	
	function qiuhe2(tblId,flag_required){
		  
		   var count2=0;
		   $("#"+tblId+" tr:gt(1)").each(function() {
			   var fund2 = $(this).children().eq("4").find("input").val();   //总价
			   if (!$.isNumeric(fund2)) fund2 = "0.00";
				count2 = accAdd(parseFloat(fund2),parseFloat(count2));  //总价		
	   		 });
	      count2 = formatNumberAutoOther(count2.toString(), 9, 2, 2);// 格式化金额
	     
	     	$("#application_total").val(count2);  
	     	
	  }
	function qiuhe3(tblId,flag_required){
		  
		   var count5=0;
		   $("#"+tblId+" tr:gt(1)").each(function() {
			   var fund2 = $(this).children().eq("3").find("input").val();   //总价
			   if (!$.isNumeric(fund2)) fund2 = "0.00";
				count5 = accAdd(parseFloat(fund2),parseFloat(count5));  //总价		
	   		 });
	      count5 = formatNumberAutoOther(count5.toString(), 9, 2, 2);// 格式化金额
	     
	     	$("#transformation_lease_budget").val(count5);  
	     	
	}
	
	function qiuhe4(tblId,flag_required){
		  
		   var count2=0;
		   $("#"+tblId+" tr:gt(1)").each(function() {
			   var fund2 = $(this).children().eq("4").find("input").val();   //总价
			   if (!$.isNumeric(fund2)) fund2 = "0.00";
				count2 = accAdd(parseFloat(fund2),parseFloat(count2));  //总价		
	   		 });
	      count2 = formatNumberAutoOther(count2.toString(), 9, 2, 2);// 格式化金额
	     
	     	$("#transformation_lease_application").val(count2);  
	     	
	  }
	
	function qiuhe5(tblId,flag_required){
		  
		   var count2=0;
		   $("#"+tblId+" tr:gt(1)").each(function() {
			   var fund2 = $(this).children().eq("7").find("input").val();   //总价
			   if (!$.isNumeric(fund2)) fund2 = "0.00";
				count2 = accAdd(parseFloat(fund2),parseFloat(count2));  //总价		
	   		 });
	      count2 = formatNumberAutoOther(count2.toString(), 9, 2, 2);// 格式化金额
	     
	     	$("#assay_list_total").val(count2);  
	     	countFundAuto('','assay_list_total,other_assay,expensive','assay_total');
	     	
	  }
	function addNewRow2(tableId,url,title)
	{
		if(url!=null&&url!=""){
			showThickBox(url,title);
			
		}//跳转页面
		else
			addNewRowDeal2($("#"+tableId));
	}

	function addNewRowDeal2(table)
	{
		var maxLinNum=table.find("tr").length-3;;//获得行数，减去表头和隐藏行
		var lineNum=""+(maxLinNum+1);
		
		var addHtml=table.find("tr")[2].innerHTML;//获得隐藏行的html,查找第二行
		addHtml=addHtml.replace(/\[index\]/g,lineNum);
		lineNum = (parseInt(lineNum, 10)-1).toString();//2011.12.13 行下标比行号小1(隐藏行下标[0]，第一行下标[00])
		if (lineNum.length==1)//如果是个位数，前面补0
			lineNum="0"+lineNum;
		addHtml=addHtml.replace(/\[0\]/g,"["+lineNum+"]");//替换html中行号
		addHtml=addHtml.replace(/\|/g,"/");//替换html中节点/的代替符"|"
		table.append("<tr>"+addHtml+"</tr>");//将html增加到最后
		/*
		table.find("tr:last").find(":text,textarea,select").not(":hidden").each(function(){
			var objClass=$(this).attr("class");
			if(objClass==null){
				objClass="required";
			}
			else if(objClass.indexOf("nvalidate")>=0){
				
			}
			else if(objClass!=null&&objClass.indexOf("required")==-1){
				objClass=objClass+" required";
			} 
			$(this).attr("class",objClass);//给所有行的列加上必填检查
		});
		*/
		//reDealRow(tbl);
	}
	/**
	 * 重新计算行号
	 * @param tblId
	 */
	function refreshRowINdex2(tblId){
		 //重新计算行号
		 
		 /*
		 *由于 refreshRowINdex:seq>1 方法将隐藏行的[0]替换成了 [00],这里将隐藏行替换回来
		 */
		 $("#"+tblId + " tr:eq(2)").find("input,span,textarea,select").each(function(){
			 var name=$(this).attr("name");
			   if(name!=null&&name!=""){
				   name=name.replace("[00]","[0]");
				   $(this).attr("name",name);
			   }
			   var id=$(this).attr("id");
			   if(id!=null&&id!=""){
				   id=id.replace("[00]","[0]");
				   $(this).attr("id",id);
			   }
			   var className=$(this).attr("class");
			   if(className!=null&&className!=""){
				   className=className.replace("[00]","[0]");;
				   $(this).attr("class",className);
			   }
		 });
		  $("#"+tblId+" tr").each(function(){
			  	
			   var seq=$(this).get(0).rowIndex;//获得行数
			   if(seq>2){//如果有行  显示时display行不计入类，故只减1
				   
				   seq=seq-2;
				   var seq_no=$(this).find("[name$='seq_no']");
				   if(seq_no.is("span"))
					   seq_no.html(seq);
				   else
					   seq_no.val(seq);
				   
				   seq=""+(seq-1);
				   if(seq.length==1)
					   seq="0"+seq;
				  //替换相应的name参数的seq
				  $(this).find("input,span,textarea,select").each(function(){
					   var name=$(this).attr("name");
					   if(name!=null&&name!=""){
						   name=name.replace(/\[\d*\]/g,"["+seq+"]");
						   $(this).attr("name",name);
					   }
					   var id=$(this).attr("id");
					   if(id!=null&&id!=""){
						   id=id.replace(/\[\d*\]/g,"["+seq+"]");
						   $(this).attr("id",id);
					   }
					   var className=$(this).attr("class");
					   if(className!=null&&className!=""){
						   className=className.replace(/\[\d*\]/g,"["+seq+"]");
						   $(this).attr("class",className);
					   }
				   });
			   }
			 }
		  );

	}
	function checkTabLimitRewrite_5(tableId,max,message)
	{
		var maxLinNum=$("#"+tableId+">tbody>tr").length;
		
			if(maxLinNum>=max)
			{
				scmWarn(message);
				return false;
			}
		return true;
	}

	
</script>


